<div class="modal-header">
    <button type="button" class="close" ng-click="$dismiss()">&times;</button>
    <div class="card-configuration-header">
        <div class="card-configuration-header-info">
            <div class="card-configuration-header-code">#{{card.code}}</div>
            <div class="card-configuration-header-creation-time-author">
                创建 {{card.creationTime}} 作者 {{card.author}}
            </div>
        </div>
    </div>
</div>
<div class="modal-body">
    <uib-tabset class="card-configuration-tabs">
        <uib-tab index="0">
            <uib-tab-heading>
                <span class="thiki-menu-ico stage-ico glyphicon glyphicon-globe"></span>
                基本信息
            </uib-tab-heading>
            <div class="tab-card-basic-info">
                <form name="cardForm" role="form" class="form-horizontal">
                    <div class="form-group">
                        <label for="cardSummary" class="col-sm-1 filed-desc">概要</label>
                        <div class="col-sm-10">
                        <textarea id="cardSummary" name="cardSummary" rows="3"
                                  class="form-control card-summary-textarea"
                                  data-ng-model="card.summary"
                                  placeholder="卡片概要"
                                  autocomplete="off"
                                  change-on-blur="saveCard()"
                                  required
                                  maxlength="60"
                                  ng-disabled="isDisableModification"/>
                            <div class="validation-error-message"
                                 ng-show="cardForm.cardSummary.$error.required && cardForm.invitee.$dirty">请填写卡片概述
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="cardSize" class="col-sm-1 filed-desc">规格</label>
                        <div id="cardSize" class="col-sm-10 card-size-col">
                            <span ng-if="isDisableModification" class="field-text">{{card.sizeName}}</span>
                            <ui-select data-ng-model="sizeList.selected" id="cardSize" on-select="saveCard()"
                                       ng-if="!isDisableModification">
                                <ui-select-match placeholder="选择规格">{{$select.selected.name}}</ui-select-match>
                                <ui-select-choices repeat="size in sizeList | filter: $select.search">
                                    <span ng-bind-html="size.name | highlight: $select.search"></span>
                                </ui-select-choices>
                            </ui-select>
                        </div>
                        <div class="field-tip">
                            <span class="glyphicon glyphicon-question-sign"
                                  aria-hidden="true"
                                  uib-tooltip="规格对应的参考点数：{S:1,M:2,L:3,XL:5,XXL:8,不可估算:9999}"
                                  tooltip-placement="right"
                                  tooltip-trigger="mouseenter"></span></div>
                        <label for="cardDeadline" class="col-sm-1 filed-desc">截止日期</label>
                        <div class="col-sm-10 input-group date-time-input">
                            <span ng-if="isDisableModification" class="field-text">{{card.deadline}}</span>
                            <input date-time
                                   id="cardDeadline"
                                   name="cardDeadline"
                                   change-on-blur="saveCard()"
                                   type="text"
                                   class="form-control"
                                   data-ng-model="card.deadline"
                                   placeholder=" 截止日期"
                                   min-view="date"
                                   format="YYYY-MM-DD"
                                   timezone="Asia/Hong_Kong"
                                   ng-if="!isDisableModification"/>
                            <div class="input-group-btn" ng-if="!isDisableModification">
                                <button type="button" class="btn btn-default input-ico" aria-label="Help"><span
                                        class="glyphicon glyphicon-time"></span></button>
                            </div>
                        </div>
                    </div>
                    <div class="form-group ">
                        <label for="assignments" class="col-sm-1 filed-desc">分配</label>
                        <div id="assignments" class="col-sm-10 members-ui-select">
                            <members-select board="board" ng-hide="isDisableModification"/>
                            <div class="assignments-list">
                                <assignments></assignments>
                            </div>
                        </div>
                    </div>
                    <div class="form-group ">
                        <label class="col-sm-1 filed-desc"></label>
                        <div id="more-options" class="col-sm-10 input-group">
                            <span class="more-options-button" ng-click="isShowMoreOptions=!isShowMoreOptions">{{isShowMoreOptions?"隐藏更多配置":"显示更多配置.."}}</span>
                        </div>
                    </div>
                    <div class="form-group" ng-if="card.parentId===undefined||card.parentId===''"
                         ng-show="isShowMoreOptions&&!isDisableModification">
                        <label for="parentCard" class="col-sm-1 filed-desc">父级卡片</label>
                        <div class="col-sm-10">
                            <input id="parentCard"
                                   name="parentCard"
                                   type="text"
                                   class="form-control thiki-input"
                                   ng-model="parentCardKeyword"
                                   ng-change="findParentCard(parentCardKeyword)"
                                   placeholder="输入编号或概述选择父卡片"/>
                            <div class="field-tip">
                                <span class="glyphicon glyphicon-question-sign"
                                      aria-hidden="true"
                                      uib-tooltip="选择所属卡片后，该卡片将作为从属卡片存在"
                                      tooltip-placement="right"
                                      tooltip-trigger="mouseenter"></span>
                            </div>
                            <div class="filter-tip"
                                 ng-class="{'alert alert-success':isResultValid,'alert alert-warning':!isResultValid}"
                                 ng-show="filterTip&&filterTip.length>0&&parentCardKeyword&&parentCardKeyword.length>0">
                                {{filterTip}}
                            </div>
                        </div>
                    </div>
                    <div class="form-group" ng-if="isShowMoreOptions&&!isDisableModification">
                        <div class="filtered-cards" ng-if="filteredCards&&filteredCards.length>0">
                            <div ng-repeat="filteredCard in filteredCards" class="filtered-card"
                                 ns-popover ns-popover-theme="ns-popover-tooltip-theme"
                                 ns-popover-template="component/card/partials/select-parent-card-popover.html"
                                 ns-popover-trigger="click"
                                 ns-popover-timeout="0"
                                 ns-popover-placement="top">
                                <div class="filter-card-code">{{filteredCard.code}}</div>
                                <div class="filter-card-summary">{{filteredCard.summary}}</div>
                            </div>
                        </div>
                    </div>
                    <div class="form-group" ng-show="isShowMoreOptions">
                        <label for="cardContent" class="col-sm-1 filed-desc">内容</label>
                        <div id="cardContent" class="col-sm-10 small-content-textarea">
                            <div markdown-to-html="card.content===undefined?'':card.content"
                                 ng-if="isDisableModification"></div>
                            <textarea name="cardContent" rows="1"
                                      class="form-control"
                                      data-ng-model="card.content"
                                      ng-change="saveCard()"
                                      ng-disabled="isDisableModification"
                                      ng-if="!isDisableModification"
                                      ng-model-options="{ debounce: 5000 }"
                                      simplemde='{spellChecker: false}'
                                      placeholder="Markdown|编辑时每5秒保存一次"></textarea>
                        </div>
                    </div>

                    <div class="form-group"
                         ng-if="isShowMoreOptions&&!isDisableModification&&card.parentId&&card.parentId!==''">
                        <label for="move-out-of-parent-card" class="col-sm-1 filed-desc filed-desc-empty"></label>
                        <div class="col-sm-10 input-group no-desc-filed" id="move-out-of-parent-card">
                            <button class="btn thiki-warning-button" type="button"
                                    ns-popover ns-popover-theme="ns-popover-tooltip-theme"
                                    ns-popover-template="component/card/partials/move-out-of-parent-card-popover.html"
                                    ns-popover-trigger="click"
                                    ns-popover-timeout="0"
                                    ns-popover-placement="top">
                                从父级卡片中移出
                            </button>
                            <span class="filed-desc-tip">移出后将作为独立卡片存在。</span>
                        </div>
                    </div>
                    <div class="form-group" ng-if="isShowMoreOptions&&!isDisableModification">
                        <label for="delete-card" class="col-sm-1 filed-desc filed-desc-empty"></label>
                        <div class="col-sm-10 input-group no-desc-filed" id="delete-card">
                            <button class="btn thiki-delete-button" type="button"
                                    ns-popover ns-popover-theme="ns-popover-tooltip-theme"
                                    ns-popover-template="component/card/partials/delete-card-popover.html"
                                    ns-popover-trigger="click"
                                    ns-popover-timeout="0"
                                    ns-popover-placement="top">
                                删除卡片
                            </button>
                            <span class="filed-desc-tip">删除后不可恢复，请谨慎操作。存在从属卡片时，将一并全部删除。</span>
                        </div>
                    </div>
                </form>
            </div>
        </uib-tab>
        <uib-tab index="1" class="acceptance-criteria-tab">
            <uib-tab-heading>
                <span class="thiki-menu-ico stage-ico glyphicon glyphicon-tasks"></span>
                验收标准<span class='badge comment-badge'
                          ng-if='acceptanceCriteriasCount>0'
                          ng-class="finishedAcceptanceCriteriasCount==acceptanceCriteriasCount?'acceptance-criteria-all-finished-badge':'acceptance-criteria-un-finished-badge'">{{finishedAcceptanceCriteriasCount}}/{{acceptanceCriteriasCount}}</span>
            </uib-tab-heading>
            <div class="tab-acceptance-criterias">
                <acceptance-criterias card="card" stage="stage"/>
            </div>
        </uib-tab>
        <uib-tab index="2">
            <uib-tab-heading>
                <span class="thiki-menu-ico stage-ico glyphicon glyphicon-tags"></span>
                标签<span class='badge comment-badge' ng-if='tagsCount>0'>{{tagsCount}}</span>
            </uib-tab-heading>
            <div class="tab-acceptance-criterias">
                <card-tags card="card" stage="stage" board="board" is-disable-modification="isDisableModification"/>
            </div>
        </uib-tab>
        <uib-tab index="3">
            <uib-tab-heading>
                <span class="thiki-menu-ico stage-ico glyphicon glyphicon-comment"></span>
                评论<span class='badge comment-badge' ng-if='commentCount>0'>{{commentCount}}</span>
            </uib-tab-heading>
            <div class="tab-comments">
                <comments card="card" stage="stage"/>
            </div>
        </uib-tab>
    </uib-tabset>
</div>

